import App from './App'
// 全局引入状态机vuex-store
import store from 'store/index.js'

// #ifndef VUE3
import Vue from 'vue'

// uView:引入全局uView,下面两行
import uView from '@/uni_modules/uview-ui'
import mixin from './common/mixin'

Vue.config.productionTip = false
App.mpType = 'app'

// uView ----------------start
Vue.use(uView)

// #ifdef MP
// 引入uView对小程序分享的mixin封装
const mpShare = require('@/uni_modules/uview-ui/libs/mixin/mpShare.js')
Vue.mixin(mpShare)
// #endif

Vue.mixin(mixin)
// uView --------------------end

// 挂载全局异步请求方法
// import {$http,$get,$post} from 'utils/request.js'
// Vue.prototype.$http = $http
// Vue.prototype.$get = $get
// Vue.prototype.$post = $post

// 优化上面的写法，遍历挂载，以后再添加新方法，就不用再处理这个了
import * as request from '@/common/api/request.js'
// console.log(request);
for(let key in request){
	Vue.prototype[key] = request[key]
}



const app = new Vue({
    ...App,
	store  //注入状态机
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif